
import java.awt.*;
import java.awt.event.*;
public class one {
	static Label  jl = new Label();
	static TextField tf = new TextField();
 public static void main(String[] args) {
  Frame f = new Frame();
  Button jb = new Button("OK"); 
  Panel jp = new Panel();
  jb.addActionListener(new ActionListener() {
   public void actionPerformed(ActionEvent e) {
    jl.setText(tf.getText());
    tf.setText("");    
   }
  }); 
  f.setLocation(100, 100);
  f.setLayout(new GridLayout(2, 1));
  jp.setLayout(new GridLayout(1,2));
  jp.add(jl);
  jp.add(jb);
  f.add(tf);
  f.add(jp);
  f.pack();
  f.addWindowListener(new WindowAdapter(){
   public void windowClosing(WindowEvent e){
    System.exit(0);
   }   
  });
  f.setVisible(true);
 }
}